<template>
  <!-- 二级主标题 -->
  <div class="title">
    {{ title }} &nbsp;
    <el-button type="text" @click="clickButton">{{ buttonText }}</el-button>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      required: false,
      default: ''
    },
    buttonText: {
      type: String,
      required: false,
      default: ''
    }
  },
  data() {
    return {
      flag: false
    }
  },
  methods: {
    clickButton() {
      this.flag = !this.flag
      this.$emit('getFlag', this.flag)
    }

  }
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.title {
  margin-bottom: 10px;
  font-size: 16px;
  color: #303133;
  font-weight: bold;
}
</style>
